﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.SweptVolume.CApSVInterferenceZoneData
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.SweptVolume;

public class CApSVInterferenceZoneData
{
  private CApSVInterferenceZoneGateData m_enter;
  private CApSVInterferenceZoneGateData m_exit;
  private ITxObject m_operation;
  private ITxLocatableObject m_simulatedObject;
  private ITxLocatableObject m_checkWithObject;

  public CApSVInterferenceZoneData()
  {
    this.m_enter = new CApSVInterferenceZoneGateData(EApSVInterferenceZoneGateType.ENTER);
    this.m_exit = new CApSVInterferenceZoneGateData(EApSVInterferenceZoneGateType.EXIT);
    this.m_operation = (ITxObject) null;
    this.m_simulatedObject = (ITxLocatableObject) null;
    this.m_checkWithObject = (ITxLocatableObject) null;
  }

  public CApSVInterferenceZoneData(
    CApSVInterferenceZoneGateData enter,
    CApSVInterferenceZoneGateData exit)
  {
    this.m_enter = enter;
    this.m_exit = exit;
  }

  public CApSVInterferenceZoneGateData Enter
  {
    get => this.m_enter;
    set => this.m_enter = value;
  }

  public CApSVInterferenceZoneGateData Exit
  {
    get => this.m_exit;
    set => this.m_exit = value;
  }

  public ITxObject Operation
  {
    get => this.m_operation;
    set => this.m_operation = value;
  }

  public ITxLocatableObject SimulatedObject
  {
    get => this.m_simulatedObject;
    set => this.m_simulatedObject = value;
  }

  public ITxLocatableObject CheckWithObject
  {
    get => this.m_checkWithObject;
    set => this.m_checkWithObject = value;
  }

  public double TimeInZone
  {
    get
    {
      return this.m_enter != null && this.m_exit != null ? this.m_exit.TimeAtZone - this.m_exit.TimeAtZone : -1.0;
    }
  }

  public override string ToString()
  {
    string str = $"{$"Interference Zone: Operation: {this.m_operation.Name}; "}Object: {((ITxObject) this.m_simulatedObject).Name}; ";
    if (this.m_enter != null)
      str = $"{str}Enter Gate : {this.m_enter.ToString()} <<>> ";
    if (this.m_exit != null)
      str = $"{str}Exit Gate : {this.m_exit.ToString()}";
    return str;
  }
}
